Skip to content

feat(ui): add hover and active states for Card component#1797

Merged
MartinS-git merged 4 commits into
mainfrom
card-hover
Jun 26, 2026
Merged

feat(ui): add hover and active states for Card component#1797
MartinS-git merged 4 commits into
mainfrom
card-hover

Conversation

@MartinS-git

@MartinS-git MartinS-git commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds interactive hover and active states to the Card component when rendered as a <button> (via onClick) or <a> (via href).

  • Hover: elevated border (border-theme-card-hover) + stronger box shadow
  • Active: accent border (border-theme-accent)
  • Cursor changes to pointer on interactive cards; cursor-not-allowed still overrides when disabled
  • Non-interactive cards (<div>) are unaffected

New CSS variables added to global.css:

  • --color-border-high (light: grey-light-9, dark: grey-blue-1)
  • --color-card-border-hover (component token)
  • --border-color-theme-card-hover (theme token)

Related Issues

Closes #1796

Checklist

  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have created a changeset for my changes.

PR Manifesto

Review the PR Manifesto for best practises.

image image

Signed-off-by: MartinS-git <info@eyepic.de>
Copilot AI review requested due to automatic review settings June 25, 2026 13:11
@MartinS-git MartinS-git requested review from a team and franzheidl as code owners June 25, 2026 13:11
@changeset-bot

changeset-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5159a3c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@cloudoperators/juno-ui-components Minor
@cloudoperators/juno-app-carbon Patch
@cloudoperators/juno-app-doop Patch
@cloudoperators/juno-app-example Patch
@cloudoperators/juno-app-greenhouse Patch
@cloudoperators/juno-app-heureka Patch
@cloudoperators/juno-app-supernova Patch
@cloudoperators/juno-app-template Patch
@cloudoperators/juno-messages-provider Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Signed-off-by: MartinS-git <info@eyepic.de>
@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-06-26 12:16 UTC

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds interactive hover/active styling for the Card component when rendered as a <button> (via onClick) or <a> (via href), introducing new theme tokens intended to drive the hover border color and updating stories/tests accordingly.

Changes:

  • Add conditional “interactive” Tailwind utility classes to Card (hover border + hover shadow + active accent border + pointer cursor).
  • Introduce new CSS variables/token chain for the card hover border color.
  • Add Storybook story and Vitest assertions for interactive styling behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/ui-components/src/global.css Adds new theme token for card hover border and supporting color variables; also changes hover shadow token value.
packages/ui-components/src/components/Card/Card.component.tsx Applies interactive hover/active classes only when href/onClick is set and not disabled.
packages/ui-components/src/components/Card/Card.test.tsx Adds tests asserting interactive class application / non-application.
packages/ui-components/src/components/Card/Card.stories.tsx Adds an interactive story to manually verify hover/active states.
.changeset/card-hover-active-states.md Declares a minor release for the new interactive Card styling.

Comment thread packages/ui-components/src/global.css
Comment thread packages/ui-components/src/global.css
Comment thread packages/ui-components/src/components/Card/Card.test.tsx Outdated
…rage

Signed-off-by: MartinS-git <info@eyepic.de>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Comment thread packages/ui-components/src/global.css
Comment thread packages/ui-components/src/global.css

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread packages/ui-components/src/components/Card/Card.component.tsx
edda
edda previously approved these changes Jun 25, 2026
Comment thread packages/ui-components/src/components/Card/Card.test.tsx
Comment thread packages/ui-components/src/components/Card/Card.component.tsx Outdated
Comment thread packages/ui-components/src/components/Card/Card.component.tsx
Comment thread packages/ui-components/src/components/Card/Card.stories.tsx Outdated
Comment thread packages/ui-components/src/global.css
Signed-off-by: MartinS-git <info@eyepic.de>
@edda edda dismissed franzheidl’s stale review June 26, 2026 11:46

Requested changes have been addressed

@ArtieReus ArtieReus reopened this Jun 26, 2026

@ArtieReus ArtieReus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@MartinS-git MartinS-git merged commit 9033fcd into main Jun 26, 2026
49 checks passed
@MartinS-git MartinS-git deleted the card-hover branch June 26, 2026 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature](Card): add hover and active states

6 participants